/* tcpServerProtocol.h */

/************************************************************************************
*                    Copyright Aquantia Corporation
*                              Freeware
*
* Description:
*
*   This file defines client-server communication commands of the TCP Server protocol
*
************************************************************************************/

/*! \file
    This file defines client-server communication commands of the TCP Server protocol
*/

#ifndef AQ_TCP_SERVER_PROTOCOL_TOKEN
#define AQ_TCP_SERVER_PROTOCOL_TOKEN


/*! \defgroup LAN LAN Configuration
This module contains the broadcast LAN configuration.
@{*/

/*! This defines the port to use for the UDP discovery server */
#define UDP_DISCOVERY_SERVER_PORT 6667

/*! This defines the port to use for the TCP server */
#define TCP_SERVER_PORT 6668

/*! This defines the multicast address for the discovery. */
#define UDP_DISCOVERY_SERVER_MULTICAST_ADDRESS "226.66.66.66"

/*! This defines the broadcast message for the discovery. */
#define BROADCAST_MESSAGE "TCP Server Query"

/*! The buffer size to use for the Tx and Rx buffers used by all functions */
#define BUFFER_SIZE 1500

/*! Defines the maximum size of the host name */
#define HOST_NAME_SIZE 200

/*@}*/


/*! \defgroup HW_Interface HW Interface
 @{*/

/*! The maximum number of block read requests that can be issued before execution of the block read.  This is set
    as 256 based on a 1500 byte Ethernet frame and requiring 5 bytes for a write */
#define MAX_BLOCK_OPERATION_SIZE 256

/*! The maximum number of PHYs per adapter */
#define MAX_NUMBER_OF_PHYS 96

/*@}*/

/*! \defgroup TCPServer TCP Server
This module contains the functions and data structures for the TCP server.  The message formats and commands are
listed below:
  
@{*/

#define CODE_HW_Initialize                   0
#define CODE_HW_OpenAdapter                  1
#define CODE_HW_CloseAdapter                 2
#define CODE_HW_Close                        3
#define CODE_HW_Write                        4
#define CODE_HW_Read                         5
#define CODE_HW_BlockOperationExecuteAdapter 6

/* @note: server accepts these commands only if it was built
          with BOARD_SUPPORT defined */
#define CODE_Board_WriteAdapter              7
#define CODE_Board_ReadAdapter               8

#define CODE_HW_GetDefaultAdapter            9
#define CODE_HW_SetDefaultAdapter            10
#define CODE_Identify                        11

/* @note: server accepts these commands only if it was built 
          with LOCKING_AND_TRACKING_SUPPORT defined */
#define CODE_HW_LockAdapter                  12
#define CODE_HW_UnlockAdapter                13
#define CODE_HW_LockPHY                      14
#define CODE_HW_UnlockPHY                    15

#define CODE_HW_Close_Internal (CODE_HW_Close + 100)

/*@}*/

#endif
